<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0"/>
    <title>web</title>
    <link rel="stylesheet" type="text/css" href="../css/aui.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <style>
        body{
            
        }
    </style>
</head>
<body>
    <header class="aui-bar aui-bar-nav bg-white" id="header">
	    <a class="aui-pull-left aui-btn" onclick="closeWin();" style="color: #333;">
	        <span class="aui-iconfont aui-icon-left" style="color: #333;"></span>&nbsp;&nbsp;返回
	    </a>
	    <div class="aui-title" id="title" style="color: #333;"></div>
	</header>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/zepto.min.js" ></script>
<script type="text/javascript" src="../script/common.js" ></script>
<script type="text/javascript">
    var headerPos;
    apiready = function(){
        api.parseTapmode();
        var header = $api.byId('header');
        $api.fixStatusBar(header);
        headerPos = $api.offset(header);

        var url = api.pageParam.url;
        var title = api.pageParam.title;
        $('#title').text(title);
        openUrl(url);
        // api.openFrame({
        //     name: 'web',
        //     url: url,
        //     rect: {
        //         x: 0,
        //         y: headerPos.h,
        //         w: 'auto',
        //         h: 'auto'
        //     },
        //     pageParam: {
        //         name: 'test'
        //     },
        //     bounces: true,
        //     bgColor: 'rgba(0,0,0,0)',
        //     vScrollBarEnabled: true,
        //     hScrollBarEnabled: false,
        //     progress:{
        //         type:'page',
        //         color:'rgba(255,0,102,1.0)'
        //     }
        // });
    };
    function openUrl(url){
        var browser = api.require('webBrowser');
        browser.openView({
            url: url,
            rect: {
                x: 0,
                y: headerPos.h,
                w: 'auto',
                h: 'auto'
            }
        }, function(ret, err) {
            switch (ret.state) {
                case 0:
                    break;
                case 1:
                    break;
                case 2:
                    break;
                case 3:
                    break;
                case 4:
                    break;
                default:
                    break;
            }
        });
    }
</script>
</html>